package com.tark.service.qrcode.util.constant;

import com.google.zxing.BarcodeFormat;

public enum FormatEnum {
    AZTEC("AZTEC",BarcodeFormat.AZTEC),
    CODABAR("CODABAR",BarcodeFormat.CODABAR),
    CODE_39("CODE_39",BarcodeFormat.CODE_39),
    CODE_93("CODE_93",BarcodeFormat.CODE_93),
    CODE_128("CODE_128",BarcodeFormat.CODE_128),
    DATA_MATRIX("DATA_MATRIX",BarcodeFormat.DATA_MATRIX),
    EAN_8("EAN_8",BarcodeFormat.EAN_8),
    EAN_13("EAN_13",BarcodeFormat.EAN_13),
    ITF("ITF",BarcodeFormat.ITF),
    MAXICODE("MAXICODE",BarcodeFormat.MAXICODE),
    PDF_417("PDF_417",BarcodeFormat.PDF_417),
    QR_CODE("QR_CODE",BarcodeFormat.QR_CODE),
    RSS_14("RSS_14",BarcodeFormat.RSS_14),
    RSS_EXPANDED("RSS_EXPANDED",BarcodeFormat.RSS_EXPANDED),
    UPC_A("UPC_A",BarcodeFormat.UPC_A),
    UPC_E("UPC_E",BarcodeFormat.UPC_E),
    UPC_EAN_EXTENSION("UPC_EAN_EXTENSION",BarcodeFormat.UPC_EAN_EXTENSION);

    private String num;
    private BarcodeFormat Format;

    FormatEnum(String num, BarcodeFormat Format) {
        this.num = num;
        this.Format = Format;
    }

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public BarcodeFormat getFormat() {
        return Format;
    }

    public void setFormat(BarcodeFormat Format) {
        this.Format = Format;
    }

    public static BarcodeFormat fromNum(String num) {
        for (FormatEnum b : FormatEnum.values()) {
            if (b.getNum().equals(num)) {
                return b.Format;
            }
        }
        return null;
    }
}
